#ifndef PARSER_MAIN_WINDOW
#define PARSER_MAIN_WINDOW

#include <QSplashScreen>
#include "SettingsDial.h"
#include "BrowserWindow.h"
#include "ErrorDial.h"
#include "OutputDial.h"
#include "SyntaxHighlighter.h"
#include "DropTreeView.h"
#include "AboutParserDial.h"
#include "ui_MWparser.h"
#include <iostream>

static bool (*prtToQtConnect)( const QObject *, const char *, const QObject *, const char*, Qt::ConnectionType ) = &QObject::connect;

#include <EXTERN.h>
#include <perl.h>

enum OutputType {screen, file, screen_file, none};

class ParserMainWindow : public QMainWindow, public Ui::MainWindow
{
    Q_OBJECT

    public :
                ParserMainWindow();
                void makeConnections();

    private slots :
                void parse();
                void outputstyleChanged();
                void inputIndexChanged(QModelIndex);
                void inputFileReceived(QString);
                void browserOutputIndexChanged(QModelIndex index);
                void outputPathChanged(QString);
                void refreshUI();
                void clear();

            signals :
                void raiseError(QString);
                // void dirModelCreated();

    private :
                int callParsingScript (const char*, const char*);

                PerlInterpreter *my_perl;

                OutputType output;

                QString outputPath;
                QString inputPath;

                QSplashScreen* splash;
                BrowserWindow* browser;
                ErrorDial* error;
                OutputDial* outputDial;
                AboutParserDial* aboutParserDial;
                SettingsDial* settings;

                SyntaxHighlighter* highlighter;

                QDirModel* model;
                DropTreeView* treeView;
};
#endif
